package com.xiaoze.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;

/**
 * @author 小泽
 * DataStream API读取集合
 * @create 2024-08-30  15:21
 * 记得每天敲代码哦
 */
public class CollectionDemo {
       public static void main(String[] args) throws Exception {
              StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
              DataStreamSource<Integer> source = env.fromElements(1, 2, 3, 4, 5);
              // DataStreamSource<Integer> source = env.fromCollection(Arrays.asList(1, 2, 3, 4, 5));
              source.print();
              env.execute();
       }
}
